package com.logos.musicframe.converter;

import com.logos.musicframe.entity.SongUploadInfo;
import com.logos.musicframe.entity.Songs;
import com.logos.musicframe.req.SongsReq;
import com.logos.musicframe.resp.SongsResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springframework.jmx.export.annotation.ManagedOperation;


/**
 * @author logos
 * date 2025/5/29 17:57
 * @version v1.0
 * @Package com.logos.musicframe.converter
 */
@Mapper
public interface SongsConverter {

    SongsConverter INSTANCE = Mappers.getMapper(SongsConverter.class);

    /**
     * entity TO resp
     * @param songs
     * @return
     */
    SongsResp convertEntityToResp(Songs songs);

    /**
     * SongUploadInfo TO Req
     */
    SongsReq convertSongUploadInfoToReq(SongUploadInfo songUploadInfo);

    /**
     * Req TO entity
     */
    @Mapping(target = "picture", ignore = true)
    @Mapping(target = "filePath", ignore = true)
    @Mapping(target = "lrc", ignore = true)
    Songs convertReqToEntity(SongsReq songsReq);

}